const router = require('koa-router')();
const authController = require('../Controller/authController');
const RealtimeDataController = require('../Controller/RealtimeDataController');

const jwtMiddleware = require('../middleware/jwt');

router.prefix('/api');

// 登录接口
router.post('/login', authController.login);

// 示例需要验证token的接口
router.post('/users', jwtMiddleware, async (ctx) => {
  // 这里可以使用token中包含的用户信息查询数据库或执行其他操作
  ctx.body = { message: `Hello, user with ID ${token.id}!` };
});

// PQ数据接口
router.post('/Outputbasic',   RealtimeDataController.getRealtimeData);

module.exports = router;
